import java.util.StringTokenizer;

public class Utils {

public static int stringtoint(String str){
    Integer i = new Integer(str);
    return i.intValue();
}

public static double stringtodouble(String str){
    Double f = new Double (str);
    return f.doubleValue();
}

boolean str_comprobarCadena( String linea, String cadena )
{ 
     if(linea== cadena) return true;
     else return (false);
} 


char stringtochar( String str )
{ 
    char c = ' ';                   
    if (str.length() > 0) { c = str.toCharArray()[0]; } 
    return ( c );                   // Devuelve un espacio si la cadena es nula
} 

String chartostring( char c )
{
    String str="";
    str += c;
    return  str;
}

public static String inttostring (int n) {
	Integer x = new Integer(n);
	String result = x.toString();	
    return (result);
}

float redondearAlza( float num, int numdec)
{
    float factor = (float) Math.pow(10.0, numdec);
    return (float) ( Math.ceil(num * factor) / (float) factor);  
}





static void tokennizar_cadena(String c, StringBuffer ... a)  {
	  StringTokenizer tokens;
	  tokens= new StringTokenizer(c,";"); //StringTokenizer tokens = new StringTokenizer(linea); 
	   
	  try{
	   for (StringBuffer x : a){
	      
	         x.append(tokens.nextToken());  
	    
	   } 
	  }
	  catch(Exception e){
		  
	  }
	  
	 }


}
